using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_HGUI_UISystem_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.HGUI.UISystem);
            args = new Type[]{};
            method = type.GetMethod("Awake", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Awake_0);
            args = new Type[]{};
            method = type.GetMethod("Start", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Start_1);
            args = new Type[]{};
            method = type.GetMethod("OnDestroy", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, OnDestroy_2);
            args = new Type[]{};
            method = type.GetMethod("Update", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Update_3);
            args = new Type[]{typeof(System.Boolean)};
            method = type.GetMethod("OnApplicationFocus", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, OnApplicationFocus_4);

            field = type.GetField("pixelWidth", flag);
            app.RegisterCLRFieldGetter(field, get_pixelWidth_0);
            app.RegisterCLRFieldSetter(field, set_pixelWidth_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_pixelWidth_0, AssignFromStack_pixelWidth_0);
            field = type.GetField("pixelHeight", flag);
            app.RegisterCLRFieldGetter(field, get_pixelHeight_1);
            app.RegisterCLRFieldSetter(field, set_pixelHeight_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_pixelHeight_1, AssignFromStack_pixelHeight_1);
            field = type.GetField("safeArea", flag);
            app.RegisterCLRFieldGetter(field, get_safeArea_2);
            app.RegisterCLRFieldSetter(field, set_safeArea_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_safeArea_2, AssignFromStack_safeArea_2);
            field = type.GetField("Instance", flag);
            app.RegisterCLRFieldGetter(field, get_Instance_3);
            app.RegisterCLRFieldSetter(field, set_Instance_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Instance_3, AssignFromStack_Instance_3);
            field = type.GetField("GestureSimulation", flag);
            app.RegisterCLRFieldGetter(field, get_GestureSimulation_4);
            app.RegisterCLRFieldSetter(field, set_GestureSimulation_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_GestureSimulation_4, AssignFromStack_GestureSimulation_4);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.HGUI.UISystem());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.HGUI.UISystem[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Awake_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UISystem instance_of_this_method = (huqiang.Core.HGUI.UISystem)typeof(huqiang.Core.HGUI.UISystem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Awake();

            return __ret;
        }

        static StackObject* Start_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UISystem instance_of_this_method = (huqiang.Core.HGUI.UISystem)typeof(huqiang.Core.HGUI.UISystem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Start();

            return __ret;
        }

        static StackObject* OnDestroy_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UISystem instance_of_this_method = (huqiang.Core.HGUI.UISystem)typeof(huqiang.Core.HGUI.UISystem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.OnDestroy();

            return __ret;
        }

        static StackObject* Update_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UISystem instance_of_this_method = (huqiang.Core.HGUI.UISystem)typeof(huqiang.Core.HGUI.UISystem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Update();

            return __ret;
        }

        static StackObject* OnApplicationFocus_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @focus = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Core.HGUI.UISystem instance_of_this_method = (huqiang.Core.HGUI.UISystem)typeof(huqiang.Core.HGUI.UISystem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.OnApplicationFocus(@focus);

            return __ret;
        }


        static object get_pixelWidth_0(ref object o)
        {
            return huqiang.Core.HGUI.UISystem.pixelWidth;
        }

        static StackObject* CopyToStack_pixelWidth_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.UISystem.pixelWidth;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_pixelWidth_0(ref object o, object v)
        {
            huqiang.Core.HGUI.UISystem.pixelWidth = (System.Int32)v;
        }

        static StackObject* AssignFromStack_pixelWidth_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @pixelWidth = ptr_of_this_method->Value;
            huqiang.Core.HGUI.UISystem.pixelWidth = @pixelWidth;
            return ptr_of_this_method;
        }

        static object get_pixelHeight_1(ref object o)
        {
            return huqiang.Core.HGUI.UISystem.pixelHeight;
        }

        static StackObject* CopyToStack_pixelHeight_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.UISystem.pixelHeight;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_pixelHeight_1(ref object o, object v)
        {
            huqiang.Core.HGUI.UISystem.pixelHeight = (System.Int32)v;
        }

        static StackObject* AssignFromStack_pixelHeight_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @pixelHeight = ptr_of_this_method->Value;
            huqiang.Core.HGUI.UISystem.pixelHeight = @pixelHeight;
            return ptr_of_this_method;
        }

        static object get_safeArea_2(ref object o)
        {
            return huqiang.Core.HGUI.UISystem.safeArea;
        }

        static StackObject* CopyToStack_safeArea_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.UISystem.safeArea;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_safeArea_2(ref object o, object v)
        {
            huqiang.Core.HGUI.UISystem.safeArea = (UnityEngine.Rect)v;
        }

        static StackObject* AssignFromStack_safeArea_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Rect @safeArea = (UnityEngine.Rect)typeof(UnityEngine.Rect).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.UISystem.safeArea = @safeArea;
            return ptr_of_this_method;
        }

        static object get_Instance_3(ref object o)
        {
            return huqiang.Core.HGUI.UISystem.Instance;
        }

        static StackObject* CopyToStack_Instance_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.UISystem.Instance;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Instance_3(ref object o, object v)
        {
            huqiang.Core.HGUI.UISystem.Instance = (huqiang.Core.HGUI.UISystem)v;
        }

        static StackObject* AssignFromStack_Instance_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UISystem @Instance = (huqiang.Core.HGUI.UISystem)typeof(huqiang.Core.HGUI.UISystem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.UISystem.Instance = @Instance;
            return ptr_of_this_method;
        }

        static object get_GestureSimulation_4(ref object o)
        {
            return ((huqiang.Core.HGUI.UISystem)o).GestureSimulation;
        }

        static StackObject* CopyToStack_GestureSimulation_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.UISystem)o).GestureSimulation;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_GestureSimulation_4(ref object o, object v)
        {
            ((huqiang.Core.HGUI.UISystem)o).GestureSimulation = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_GestureSimulation_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @GestureSimulation = ptr_of_this_method->Value == 1;
            ((huqiang.Core.HGUI.UISystem)o).GestureSimulation = @GestureSimulation;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Core.HGUI.UISystem();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
